package com.qifei.xmlg_backend.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author user
 * @since 2025-06-15
 */
@ApiModel(value = "User对象", description = "用户表")
@Data
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @ApiModelProperty("用户ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名
     */
    @ApiModelProperty("用户名")
    private String username;

    /**
     * 密码
     */
    @ApiModelProperty("密码")
    private String password;

    /**
     * 性别（1男 2女）
     */
    @ApiModelProperty("性别（1男 2女）")
    private Byte gender;

    /**
     * 邮箱
     */
    @ApiModelProperty("邮箱")
    private String email;

    /**
     * 头像URL
     */
    @ApiModelProperty("头像URL")
    private String avatar;

    /**
     * 角色标识
     */
    @ApiModelProperty("角色标识")
    private String role;

    /**
     * 状态（1启用 0禁用）
     */
    @ApiModelProperty("状态（1启用 0禁用）")
    private Byte status;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @Override
    public String toString() {
        return "User{" +
                "id = " + id +
                ", username = " + username +
                ", password = " + password +
                ", gender = " + gender +
                ", email = " + email +
                ", avatar = " + avatar +
                ", role = " + role +
                ", status = " + status +
                ", createTime = " + createTime +
                ", updateTime = " + updateTime +
                "}";
    }
}
